/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.igorov.efficientsoft.business.gestorzona;

import com.igorov.efficientsoft.dataaccess.domain.ZonaDAO;
import com.igorov.efficientsoft.dataaccess.model.TzonaVO;
import com.igorov.efficientsoft.services.DistritoDTO;
import com.igorov.efficientsoft.services.ZonaDTO;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

/**
 *
 * @author igorov
 */
public class GestorZonaImpl implements GestorZona{

    private ZonaDAO zonaDAO;

    public List<ZonaDTO> getAllByDistrito(int idDistrito) {
        List<TzonaVO> tzonaVOs = zonaDAO.getAllByCiudad(idDistrito);
        List<ZonaDTO> zonaDTOs = new LinkedList<ZonaDTO>();
        
        for (Iterator<TzonaVO> it = tzonaVOs.iterator(); it.hasNext();) {
            TzonaVO tzonaVO = it.next();
            ZonaDTO zonaDTO = new ZonaDTO(tzonaVO.getNcodZon(),
                                            tzonaVO.getTdistrito().getNcodDis(),
                                            tzonaVO.getCnomZon());
            zonaDTOs.add(zonaDTO);
        }
        
        return zonaDTOs;
    }

    public ZonaDAO getZonaDAO() {
        return zonaDAO;
    }

    public void setZonaDAO(ZonaDAO zonaDAO) {
        this.zonaDAO = zonaDAO;
    }
    
    public void deleteById(int i) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void deleteByIndex(int index) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public List<ZonaDTO> getAll() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public ZonaDTO getById(int voId) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public ZonaDTO getByIndex(int indice) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public int getIdAtIndex(int indice) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public int getIndexOf(int voId) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void saveOrUpdate(ZonaDTO o) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void updateListVo() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
}
